#pragma once

namespace banknamespace
{
	struct vec2
	{
		float x;
		float y;

		vec2() : x(0), y(0) {}
		vec2(float _x, float _y) : x(_x), y(_y) {}
	};

	class Mouse
	{
	public:

		/*class MouseListener
		{
		public:
			virtual bool onUp() = 0;
			virtual bool onDown() = 0;
			virtual bool onClick() = 0;
		}*/

		// GetKeyboardState();
		// VK_SPACE
		// WM_KEYDOWN
		// WM_KEYUP

		typedef unsigned int ButtonId;

		Mouse( HWND hWnd);

		unsigned int getNumButtons() const;
		vec2 getPosition() const;

		bool didGoUp(ButtonId button) const;
		bool didGoDown(ButtonId button) const;
		bool isDown(ButtonId button) const;
		bool isDblClick() const;

		void update(); // TODO remove if unneeded

		void processMessages(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	private:
		static const unsigned int MAX_BUTTONS = 3;
		HWND m_hWnd;
		bool m_buttonStates[MAX_BUTTONS]; // true is down
		bool m_lastButtonStates[MAX_BUTTONS];
		bool m_dblClick;
	};

	Mouse& GetTheMouse(HWND hWnd = NULL);
}

//namespace UseCase
//{
//	class Player : public Sprite, public Mouse::MouseListener
//	{
//	public:
//		virtual void updateSimulation()
//		{
//			Mouse& mouse = ???;
//			if (mouse.didClick())
//			{
//				Explode();
//			}
//		}
//		virtual bool onUp()
//		{
//			FireBullet();
//		}
//		virtual bool onDown() = 0;
//		virtual bool onClick() = 0;
//	}
//}
//
//#endif